package com.hddf.project.pojos;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "first_category")
public class FirstCategory {
	private int first_category_id;
	private String first_category_name;
	private int sort;
	private List<SecondCategory> secondCategories;
	
	private int count;//项目数量

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "first_category_id", nullable = false, unique = true)
	public int getFirst_category_id() {
		return first_category_id;
	}

	public void setFirst_category_id(int first_category_id) {
		this.first_category_id = first_category_id;
	}

	@Column(name = "first_category_name", nullable = false, unique = true)
	public String getFirst_category_name() {
		return first_category_name;
	}

	public void setFirst_category_name(String first_category_name) {
		this.first_category_name = first_category_name;
	}

	@Column(name = "sort")
	public int getSort() {
		return sort;
	}

	public void setSort(int sort) {
		this.sort = sort;
	}

	@Transient
	public List<SecondCategory> getSecondCategories() {
		return secondCategories;
	}

	public void setSecondCategories(List<SecondCategory> secondCategories) {
		this.secondCategories = secondCategories;
	}
	
	@Transient
	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public FirstCategory() {

	}

	public FirstCategory(int first_category_id) {
		this.first_category_id = first_category_id;
	}
}
